const SockJS = require('sockjs-client');

var sock = new SockJS('http://localhost:8080/sockjs-node');

sock.onopen = function () {
	console.log('open');
	sock.send('test');
};

sock.onmessage = function (e) {
	console.log('message', e.data);
	sock.close();
};

sock.onclose = function () {
	console.log('close');
};